package com.example.mqtt.controller


//import com.example.management.client.TestClient
import com.example.management.client.TestClient
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody

@Controller
@RequestMapping("/test")
class TestApi {

    @Autowired
    var testClient : TestClient? = null;

    @ResponseBody
    @GetMapping("hello")
    fun hello():String {

        return  "hello mqtt"
    }

    @ResponseBody
    @GetMapping("helloManagement")
    fun helloManagement():String {
        if (testClient!=null){
            return testClient!!.hello();
        }
        return  "hello mqtt"
    }

}